// Tags:
#include <cstdio>

const int N = 5e3 + 5;
int n, m, k, sx, sy, dx, dy;
bool map[N][N], vis[N][N];
char dir[3];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("ray.in", "r", stdin);
  freopen("ray.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1, x, y; i <= k; ++i) scanf("%d%d", &x, &y), map[x][y] = true;
  for (int i = 0; i <= n + 1; ++i) map[i][0] = map[i][m + 1] = true;
  for (int i = 0; i <= m + 1; ++i) map[0][i] = map[n + 1][i] = true;
  scanf("%d%d%s", &sx, &sy, dir);
  dx = dir[0] == 'S' ? 1 : -1;
  dy = dir[1] == 'E' ? 1 : -1;
  for (int i = 0, tx, ty; i < 50000000; ++i) {
    tx = sx + dx, ty = sy + dy;
    vis[sx][sy] = true;
    if (!map[tx][ty]) sx = tx, sy = ty;
    else {
      tx = dx, ty = dy;
      sx += dx, sy += dy;
      if (map[sx][sy - ty]) dx = -dx, sx -= tx;
      if (map[sx - tx][sy]) dy = -dy, sy -= ty;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j)
      if (vis[i][j]) ++ans;
  }
  printf("%d", ans);
  return 0;
}